﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;

public partial class service_self : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["username"] != null && Session["userpwd"] != null)
            {
                string userName = Session["username"].ToString();
                string pwd = Session["userpwd"].ToString();
                //Qkcl(userName, pwd);
                this.hidName.Value = userName;
                //lblUser.Text = userName;
            }
            else
            {
                Response.Redirect("service_self.aspx");
            }
        }
    }
    /// <summary>
    /// 清空处理
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public void Qkcl(string uname, string upwd)
    {
        try
        {
            emoneybussiness.emoneybusiness service = new emoneybussiness.emoneybusiness();
            string result = service.ClearUserHardware(uname, upwd);
            ClientScript.RegisterStartupScript(GetType(), "a", "alert('" + result + "');", true);
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(GetType(), "a", "alert('服务器忙，请重试');", true);
        }
    }
    /// <summary>
    /// 硬件清空
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    //protected void imgbtnHardwareClear_Click(object sender, ImageClickEventArgs e)
    //{
    //    string code = (string)Session["code"];
    //    if (code.Trim() == codepc.Text.Trim())
    //    {
    //        string userName = Session["username"].ToString();
    //        string pwd = Session["userpwd"].ToString();
    //        Qkcl(userName, pwd);
    //    }
    //    else
    //    {
    //        ClientScript.RegisterStartupScript(GetType(), "a", "alert('验证码不正确');", true);
    //    }
    //}
}